package com.uex.dev.manage.admin.vo.wx;

import com.uex.dev.manage.admin.enums.UserTypeEnum;
import com.uex.dev.manage.admin.po.UserPO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * @author lzs
 * @create 2024/02/27
 * @description
 */
@Schema(description = "获取WXID绑定关系响应参数")
@Data
public class BindResp {
    @Schema(description = "访客绑定的项目ID")
    private Integer guestPrjid;
    @Schema(description = "用户ID")
    private Integer userId;
    @Schema(description = "用户类型")
    private UserTypeEnum userType;
    @Schema(description = "用户名称")
    private String userName;

    public static BindResp fromPO(UserPO userPO) {
        BindResp bindResp = new BindResp();
        BeanUtils.copyProperties(userPO, bindResp);
        bindResp.setUserId(userPO.getId());
        return bindResp;
    }
}

